import React from "react";
import { Button, Image, Space } from "antd";
import dictTag from "@/component/Dict-Tag/Dict-Tag";
import { DICT_TYPE, getIntDictOptions } from "@/utils/dict";
/**@description 列表表格字段 */
const getColumns = ({ open = Function, handleDelete = Function }) => {
    const columns = [
        {
            title: "属性名称",
            key: "propertyName",
            dataIndex: "propertyName",
            width: 180,
            ellipsis: true
        },
        {
            title: "行业类目",
            key: "className",
            dataIndex: "className",
            width: 80,
        },
        {
            title: "排序",
            key: "sort",
            dataIndex: "sort",
            width: 80,
        },
        {
            title: "状态",
            key: "status",
            dataIndex: "status",
            width: 80,
            render: (value, record) => dictTag({
                type: DICT_TYPE.PRODUCT_BRAND_STATUS,
                value: value
            })
        },

        {
            title: "操作",
            key: "action",
            dataIndex: "action",
            width: 200,
            render: (text, record) => {
                return (
                    <>
                        <Button type="link" onClick={() => open({ type: "update", record })}>修改</Button>
                        <Button type="link" danger onClick={() => handleDelete(record)}>删除</Button>
                    </>
                )
            }
        },
    ];
    return columns;
}

export default getColumns;